// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'


import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

import axios from 'axios';
import VueAxios from 'vue-axios';



//给Vue函数添加一个原型属性$axios 指向Axios
//这样做的好处是在vue实例或组件中不用再去重复引用Axios 直接用this.$axios就能执行axios 方法了
Vue.use(VueAxios,axios)
Vue.prototype.$axios=axios;

//解决跨域问题
axios.defaults.baseURL="http://localhost:8080/BMS/";
axios.defaults.headers.post['Content-Type']='application/json';

Vue.use(router);
Vue.use(ElementUI);
Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  render:h=>h(App)
  /* 上述代码缩写,就是在创建elementui
      render: function (createElement) {
        return createElement(App); }*/

})
